from selenium.webdriver.common.by import By

from base import Base

class Page(Base):
    def sou(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        ele=self.find_ele(loc)
        return ele
    def shur(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    def dianjianniu(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.find_ele(loc)
        return ele
    def diantupian(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.xiachufang:id/common_photo_image_view"])[1]')
        ele=self.find_ele(loc)
        return ele
    def soucang(self):
        loc=(By.ID,'com.xiachufang:id/recipe_bto_nav_bar_collect')
        ele=self.find_ele(loc)
        return ele
    def hd(self):
        self.huadong(473,1579,473,971)
    def fanhui(self):
        self.qingqiao(77,150)
    def jiachang(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/tv_content" and @text="家常"]')
        ele=self.find_ele(loc)
        return ele
    def zonghe(self):#断言：综合
        loc=(By.XPATH,'//android.widget.TextView[@text="综合"]')
        ele=self.find_ele(loc)
        return ele
    def yemian(self):
        loc=(By.ID,'com.xiachufang:id/tv_load_status_major')
        ele=self.find_ele(loc)
        return ele
